﻿use strict;


sub survey_createGroup
{	
		my $number;
	($number) = @_;
	#打印说明信息
	&myprint("description",$number);
	
	#读取公共资源
	my @survey = &config("","sql");
	#管理后台地址
	my $mgt_addr = &config("","mgt_addr");
	#手机服务地址
	my $mob_addr = &config("","mob_addr");
	
	#被测用户账号
	my @username = &readLine('1407996376_5_survey_0305.txt');
	#开始获取被测用户id
	my @user_id;
	for(@username){
		my $sql = "SELECT USER_ID FROM `USER_ACCOUNT` WHERE LOGIN_NAME='$_';";
		push @user_id, &operate_mysql(@survey,"$sql","select");
	}

	#创建用户组文件
	open WCSV,">data//1.csv";
	my @useridIndex = (0,1,3,4);
	for(@useridIndex){
		print WCSV "$user_id[--$_]\n";
	}
	close WCSV;
	
	#管理后台登录请求
	my ($mgtbrowser);
	($mgtbrowser) = &mgtlogin($mgt_addr,"admin");
	
	#用户组id12
	my $id = &saveGroup($mgtbrowser,$mgt_addr,'data//1.csv');	
	print "id  $id\n";
	
	return 1;

}
1;